﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessRules;
using System.Data;
using System.Collections;

namespace BusinessLibary
{
    public class YBYPInfoFacade
    {
        public YBYPInfoFacade()
		{
		}
				
		
		#region 业务外观层操作

		public void insertEntity(DataSet entityData)
		{
			try
			{
				YBYPInfoRules rule=new YBYPInfoRules();
				rule.insertEntity(entityData);
			}
			catch(Exception e)
			{
				throw new Exception(e.Message ,e);
			}
		}


		public void updateEntity(DataSet entityData)
		{
			try
			{
				YBYPInfoRules rule=new YBYPInfoRules();
				rule.updateEntity(entityData);
			}
			catch(Exception e)
			{
				throw new Exception(e.Message ,e);
			}
		}

		
		public void deleteEntity(DataSet entityData)
		{
			try
			{
				YBYPInfoRules rule=new YBYPInfoRules();
				rule.deleteEntity(entityData);
			}
			catch(Exception e)
			{
				throw new Exception(e.Message ,e);
			}
		}

		
		public DataSet FindByPrimaryKey(object strKeyValue)
		{
			try
			{
				YBYPInfoRules rule=new YBYPInfoRules();
				return rule.FindByPrimaryKey(strKeyValue);
			}
			catch(Exception e)
			{
				throw new Exception(e.Message ,e);
			}
		}

		
		public DataSet FindByPrimaryKey(ArrayList KeyValue)
		{
			try
			{
				YBYPInfoRules rule=new YBYPInfoRules();
				return rule.FindByPrimaryKey(KeyValue);
			}
			catch(Exception e)
			{
				throw new Exception(e.Message ,e);
			}
		}

		#endregion

        public DataSet FindAll()
        {
            try
            {
                YBYPInfoRules rule = new YBYPInfoRules();
                return rule.FindAll();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }

        /// <summary>
        /// 清空实体记录
        /// </summary>
        public void deleteEntity()
        {
            try
            {
                YBYPInfoRules rule = new YBYPInfoRules();
                rule.deleteEntity();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message, e);
            }
        }
	    
	}

}
